#
# Copyright 2008 Jeffrey Palm
#

NAME=floto
PROJ=photos

all: clean dist

%.tar.gz:%.tar
	gzip -9 -f $<

%.php:%.inc Makefile
	cat $< | sed -e "s/= '.*';/\= 'FILL THIS IN';/g" > $@

%.properties:%.php
	perl -n make_properties.pl $< > $@


%.template:%.properties
	cat $< | sed -e "s/=.*/=FILL THIS IN/g" > $@

$(PROJ)/%.template:$(PROJ)/%.properties
	cat $< | sed -e "s/=.*/=FILL THIS IN/g" > $@

$(NAME).tar: user.template $(PROJ)/config.template *.php $(PROJ)/*.php $(PROJ)/cron/*.php
	tar cvf $@ $^

dist: $(NAME).tar.gz

upload: dist
	ant upload

clean:
	rm -rf `find . -name "*~"` config.properties user.template $(NAME).tar.gz $(NAME).tar